from appium.webdriver.common.multi_action import MultiAction
from appium.webdriver.common.touch_action import TouchAction


def smaller(driver):
    x = driver.get_window_size()['width']
    y = driver.get_window_size()['height']
    t1 = TouchAction(driver)
    t2 = TouchAction(driver)
    t1.press(x=x * 0.2, y=y * 0.2).move_to(x=0.4 * x, y=0.4 * y).wait(1000).release()
    t2.press(x=x * 0.8, y=y * 0.8).move_to(x=0.6 * x, y=0.6 * y).wait(1000).release()
    small = MultiAction(driver)
    small.add(t1, t2)
    small.perform()


def bigger(driver):
    x = driver.get_window_size()['width']
    y = driver.get_window_size()['height']
    t1 = TouchAction(driver)
    t2 = TouchAction(driver)
    t1.press(x=x * 0.4, y=y * 0.4).move_to(x=0.2 * x, y=0.2 * y).wait(1000).release()
    t2.press(x=x * 0.6, y=y * 0.6).move_to(x=0.8 * x, y=0.8 * y).wait(1000).release()
    small = MultiAction(driver)
    small.add(t1, t2)
    small.perform()
